﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeCircArc2d : OdGeCurve2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeCircArc2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeCircArc2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeCircArc2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeCircArc2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeCircArc2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeCircArc2d() : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGeCircArc2d source) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_1(OdGeCircArc2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d center, double radius) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_2(OdGePoint2d.getCPtr(center), radius), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d center, double radius, double startAng, double endAng, OdGeVector2d refVec, bool isClockWise) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_3(OdGePoint2d.getCPtr(center), radius, startAng, endAng, OdGeVector2d.getCPtr(refVec).Handle, isClockWise), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d center, double radius, double startAng, double endAng, OdGeVector2d refVec) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_4(OdGePoint2d.getCPtr(center), radius, startAng, endAng, OdGeVector2d.getCPtr(refVec).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d center, double radius, double startAng, double endAng) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_5(OdGePoint2d.getCPtr(center), radius, startAng, endAng), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d startPoint, OdGePoint2d secondPoint, OdGePoint2d endPoint) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_6(OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(secondPoint), OdGePoint2d.getCPtr(endPoint)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d startPoint, OdGePoint2d endPoint, double bulge, bool bulgeFlag) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_7(OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(endPoint), bulge, bulgeFlag), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCircArc2d(OdGePoint2d startPoint, OdGePoint2d endPoint, double bulge) : this(GlobalsPINVOKE.new_OdGeCircArc2d__SWIG_8(OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(endPoint), bulge), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool intersectWith(OdGeLinearEnt2d line, out int numInt, OdGePoint2d p1, OdGePoint2d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt2d line, out int numInt, OdGePoint2d p1, OdGePoint2d p2)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt2d.getCPtr(line), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeCircArc2d circarc, out int numInt, OdGePoint2d p1, OdGePoint2d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_intersectWith__SWIG_2(this.swigCPtr, OdGeCircArc2d.getCPtr(circarc), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeCircArc2d circarc, out int numInt, OdGePoint2d p1, OdGePoint2d p2)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_intersectWith__SWIG_3(this.swigCPtr, OdGeCircArc2d.getCPtr(circarc), out numInt, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool tangent(OdGePoint2d point, OdGeLine2d line, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_tangent__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeLine2d.getCPtr(line), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool tangent(OdGePoint2d point, OdGeLine2d line)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_tangent__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeLine2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool tangent(OdGePoint2d point, OdGeLine2d line, OdGeTol tol, out OdGe.ErrorCondition status)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_tangent__SWIG_2(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeLine2d.getCPtr(line), OdGeTol.getCPtr(tol), out status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint2d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_isInside__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint2d point)
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_isInside__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d center()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeCircArc2d_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double radius()
		{
			double result = GlobalsPINVOKE.OdGeCircArc2d_radius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double startAng()
		{
			double result = GlobalsPINVOKE.OdGeCircArc2d_startAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double endAng()
		{
			double result = GlobalsPINVOKE.OdGeCircArc2d_endAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isClockWise()
		{
			bool result = GlobalsPINVOKE.OdGeCircArc2d_isClockWise(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector2d refVec()
		{
			OdGeVector2d result = new OdGeVector2d(GlobalsPINVOKE.OdGeCircArc2d_refVec(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d startPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeCircArc2d_startPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d endPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeCircArc2d_endPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d setCenter(OdGePoint2d center)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_setCenter(this.swigCPtr, OdGePoint2d.getCPtr(center)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d setRadius(double radius)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_setRadius(this.swigCPtr, radius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d setAngles(double startAng, double endAng)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_setAngles(this.swigCPtr, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d setToComplement()
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_setToComplement(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d setRefVec(OdGeVector2d vect)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_setRefVec(this.swigCPtr, OdGeVector2d.getCPtr(vect).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d center, double radius)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(center), radius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d center, double radius, double startAng, double endAng, OdGeVector2d refVec, bool isClockWise)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(center), radius, startAng, endAng, OdGeVector2d.getCPtr(refVec).Handle, isClockWise), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d center, double radius, double startAng, double endAng, OdGeVector2d refVec)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_2(this.swigCPtr, OdGePoint2d.getCPtr(center), radius, startAng, endAng, OdGeVector2d.getCPtr(refVec).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d center, double radius, double startAng, double endAng)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_3(this.swigCPtr, OdGePoint2d.getCPtr(center), radius, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d startPoint, OdGePoint2d secondPoint, OdGePoint2d endPoint)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_4(this.swigCPtr, OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(secondPoint), OdGePoint2d.getCPtr(endPoint)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d startPoint, OdGePoint2d secondPoint, OdGePoint2d endPoint, out OdGe.ErrorCondition status)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_5(this.swigCPtr, OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(secondPoint), OdGePoint2d.getCPtr(endPoint), out status), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d startPoint, OdGePoint2d endPoint, double bulge, bool bulgeFlag)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_6(this.swigCPtr, OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(endPoint), bulge, bulgeFlag), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGePoint2d startPoint, OdGePoint2d endPoint, double bulge)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_7(this.swigCPtr, OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(endPoint), bulge), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGeCurve2d curve1, OdGeCurve2d curve2, double radius, out double param1, out double param2, out bool success)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_8(this.swigCPtr, OdGeCurve2d.getCPtr(curve1), OdGeCurve2d.getCPtr(curve2), radius, out param1, out param2, out success), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d set(OdGeCurve2d curve1, OdGeCurve2d curve2, OdGeCurve2d curve3, out double param1, out double param2, out double param3, out bool success)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_set__SWIG_9(this.swigCPtr, OdGeCurve2d.getCPtr(curve1), OdGeCurve2d.getCPtr(curve2), OdGeCurve2d.getCPtr(curve3), out param1, out param2, out param3, out success), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCircArc2d Assign(OdGeCircArc2d arc)
		{
			OdGeCircArc2d result = new OdGeCircArc2d(GlobalsPINVOKE.OdGeCircArc2d_Assign(this.swigCPtr, OdGeCircArc2d.getCPtr(arc)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getGeomExtents(OdGeExtents2d extents)
		{
			GlobalsPINVOKE.OdGeCircArc2d_getGeomExtents(this.swigCPtr, OdGeExtents2d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double startAngFromXAxis()
		{
			double result = GlobalsPINVOKE.OdGeCircArc2d_startAngFromXAxis(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double endAngFromXAxis()
		{
			double result = GlobalsPINVOKE.OdGeCircArc2d_endAngFromXAxis(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
